package org.opens.kafka.controller;

import org.opens.kafka.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/kafka")
public class KafkaController {

    @Autowired
    private MessageService messageService;

    @GetMapping(value = "/send/{id}")
    public void send(@PathVariable(value = "id") String id) {
        messageService.sendMessage(id);
    }

}
